<include file="Public:header" />
<style>
    .table_form tbody th{text-align:center;color:#000;}
    .table_form tbody th.left{text-align:left;}
</style>
<form id="info_form" action="{:U('Nav/add')}" method="post" enctype="multipart/form-data">
    <div class="pad_lr_10">
        <div class="col_tab">
            <ul class="J_tabs tab_but cu_li">
                <li class="current">栏目导航</li>
                <li>页脚导航</li>
            </ul>
            <div class="content_list pad_10">
                说明：文章页url结构(列表页:/news 详细页：/news/3)<br />
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                产品页url结构(列表页:/product 详细页：/product/3)<br />
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                单页面url结构(/pages/guangxuwomen)<br />
                注：&nbsp;&nbsp;&nbsp;
                如果获取指定栏目下的所有文章则(/news/xinweizhongxin)即可，news后面的参数为 栏目别名（产品同文章一样）<br />

            </div>
            <div class="J_panes">

                <div class="content_list pad_10">
                    <table width="100%" cellspacing="0" class="table_form">
                        <tr>
                            <th width="120" align="center">栏目名称</th>
                            <th width="400">url</th>
                            <th width="80">打开方式</th>
                            <th width="60">排序</th>
                            <th width="60">状态</th>
                            <th class="left">管理</th>
                        </tr>
                        <volist name="listheader" id="vo">
                            <tr>
                                <td><input type="text" name="info[name][]" value="{$vo.name}" class="input-text" size="20" /></td>
                                <td><input type="text" name="info[url][]" value="{$vo.url}" class="input-text" size="60" /></td>
                                <td>
                                    <select name="info[opentype][]">
                                        <option value="_self" <if condition="$vo['opentype'] eq '_self'">selected</if>>当前页面</option>
                                        <option value="_blank" <if condition="$vo['opentype'] eq '_blank'">selected</if>>新页面</option>
                                    </select>

                                </td>
                                <td>
                                    <input type="text" name="info[ordid][]" value="{$vo.ordid}" class="input-text" size="5"/>
                                </td>
                                <td>
                                    <select name="info[status][]">
                                        <option value="1"  <if condition="$vo['status'] eq '1'">selected</if>>启用</option>
                                        <option value="0" <if condition="$vo['status'] eq '0'">selected</if>>禁用</option>
                                    </select>
                                </td>
                                <td>
                                    <a href="javascript:;" onclick="delCols(this);">移除</a>
                                </td>
                            </tr>
                        </volist>
                        <tr>
                            <td><input type="text" name="info[name][]" value="" class="input-text" size="20" /></td>
                            <td><input type="text" name="info[url][]" value="" class="input-text" size="60" /></td>
                            <td>
                                <select name="info[opentype][]">
                                    <option value="_self">当前页面</option>
                                    <option value="_blank" selected>新页面</option>
                                </select>
                            </td>
                            <td>
                                <input type="text" name="info[ordid][]" value="" class="input-text" size="5"/>
                            </td>
                            <td>
                                <select name="info[status][]">
                                    <option value="1" selected>启用</option>
                                    <option value="0">禁用</option>
                                </select>

                            </td>
                            <td>
                                <a href="javascript:;" onclick="addCols(this);" class="btn btn_submit">添加</a>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="content_list pad_10 hidden">
                    <table width="100%" cellspacing="0" class="table_form">
                        <tr>
                            <th width="120" align="center">栏目名称</th>
                            <th width="400">url</th>
                            <th width="80">打开方式</th>
                            <th width="60">排序</th>
                            <th width="60">状态</th>
                            <th class="left">管理</th>
                        </tr>
                        <volist name="listfooter" id="vo">
                            <tr>
                                <td><input type="text" name="footer[name][]" value="{$vo.name}" class="input-text" size="20" /></td>
                                <td><input type="text" name="footer[url][]" value="{$vo.url}" class="input-text" size="60" /></td>
                                <td>
                                    <select name="footer[opentype][]">
                                        <option value="_self" <if condition="$vo['opentype'] eq '_self'">selected</if>>当前页面</option>
                                        <option value="_blank" <if condition="$vo['opentype'] eq '_blank'">selected</if>>新页面</option>
                                    </select>
                                </td>
                                <td>
                                    <input type="text" name="footer[ordid][]" value="{$vo.ordid}" class="input-text" size="5"/>
                                </td>
                                <td>
                                    <select name="footer[status][]">
                                        <option value="1"  <if condition="$vo['status'] eq '1'">selected</if>>启用</option>
                                        <option value="0" <if condition="$vo['status'] eq '0'">selected</if>>禁用</option>
                                    </select>
                                </td>
                                <td>
                                    <a href="javascript:;" onclick="delCols(this);">移除</a>
                                </td>
                            </tr>
                        </volist>
                        <tr>
                            <td><input type="text" name="footer[name][]" value="" class="input-text" size="20" /></td>
                            <td><input type="text" name="footer[url][]" value="" class="input-text" size="60" /></td>
                            <td>
                                <select name="footer[opentype][]">
                                    <option value="_self">当前页面</option>
                                    <option value="_blank" selected>新页面</option>
                                </select>
                            </td>
                            <td>
                                <input type="text" name="footer[ordid][]" value="" class="input-text" size="5"/>
                            </td>
                            <td>
                                <select name="footer[status][]">
                                    <option value="1" selected>启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </td>
                            <td>
                                <a href="javascript:;" onclick="addCols(this);" class="btn btn_submit">添加</a>
                            </td>
                        </tr>

                    </table>
                </div>

            </div>
            <div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
        </div>
    </div>
</form>
<include file="Public:footer" />
<script>
    $(function() {
        $('ul.J_tabs').tabs('div.J_panes > div');
        //颜色选择器
        //$('.J_color_picker').colorpicker();
    });
    function addCols(o){
        var obj = $(o);
        var str = obj.parents('tr').clone();
        var delstr = "<a href='javascript:;' onclick='delCols(this)'>移除</a>";
        str.find('input[name="info[url][]"]').val('');
        str.find('input[name="info[name][]"]').val('');
        str.find('input[name="footer[url][]"]').val('');
        str.find('input[name="footer[name][]"]').val('');
        str.find('a').remove();
        str.children("td:last-child").html(delstr);
        obj.parents('table').append(str);
       // $(".table_form").append(str);
    }
    function delCols(o){
        var obj = $(o);
        obj.parents('tr').remove();
    }
</script>
</body>
</html>